package myky.com.doctorapp.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import myky.com.doctorapp.R
import myky.com.doctorapp.entity.AreaWrapperEntity

class FindDoctorProvinceAdapter(data: List<AreaWrapperEntity.DataBean.AreaBean>) : BaseQuickAdapter<AreaWrapperEntity.DataBean.AreaBean, BaseViewHolder>(R.layout.province_item,data) {

    override fun convert(holder: BaseViewHolder?, item: AreaWrapperEntity.DataBean.AreaBean) {
        holder?.let {
            it.setText(R.id.pop_parent_tv, item.province)
            val selected = item.isSelected
            if (selected) {
                it.setBackgroundRes(R.id.pop_parent_layout, R.color.white)
            } else {
                it.setBackgroundRes(R.id.pop_parent_layout, R.color.gray_eeeeee)
            }
            it.addOnClickListener(R.id.rootView)
        }

    }
}